import { createRouter, createWebHistory } from 'vue-router'
import { constRouter } from './routers'

const create = () => {
  return createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes: constRouter
  })
}

const router = create()

export function resetRouter() {
  const newRouter = create()
  router.resolve = newRouter.resolve
}

export default router
